package com.xintouyun.medicine.service.impl;

import java.util.List;

import com.xintoucloud.jdbcutil.JdbcUtil;
import com.xintouyun.medicine.dao.AptitudeDao;
import com.xintouyun.medicine.entity.Aptitude;
import com.xintouyun.medicine.service.AccountService;

public class AccountServiceImpl implements AccountService{
	private AptitudeDao aptitudeDao = new AptitudeDao();
	@Override
	public List<Aptitude> list(int uid) {
		try {
			List<Aptitude> list = aptitudeDao.list("select nickname,a.aname,serve,firmservice,gsp,linkman,phone,email,address,a.owner from m_user u inner join m_aptitude a on u.aname=a.aname where uid=?",uid);
			
			return list;
			
		} finally {
			JdbcUtil.closeConnection();
		}
	}
	@Override
	public int updata(String picpath,int aid) {
		int i = 0;
		try {
			i = aptitudeDao.update("update m_aptitude set firmservice=? where aid=?",picpath,aid);
		} finally {
			JdbcUtil.closeConnection();
		}
		return i;
	}
	
	
}
